import {
    request
} from "../apl/core"
import apl from "../apl/path"

const Api = {
    goodsList() {
        return request(apl.METHODS.GET, apl.URL.GOODSLIST)
    },
    swiperList() {
        return request(apl.METHODS.GET, apl.URL.SWIPERLIST)
    },
    required(page, pageSize) {
        return request(apl.METHODS.GET, apl.URL.REQUIRED, {
            page,
            pageSize
        })
    },
    special() {
        return request(apl.METHODS.GET, apl.URL.SPECIAL)
    },
    popularity(params) {
        return request(apl.METHODS.GET, apl.URL.POPULARITYDETAILS, params)
    },
    classify() {
        return request(apl.METHODS.GET, apl.URL.CLASSIFY)
    },
    login(username, password) {
        return request(apl.METHODS.GET, apl.URL.LOGIN, {
            params: {
                mobile: String(username),
                pwd: Number(password)
            }
        })
    }
}

export default Api